package com.huaqin.obeacons;

import com.huaqin.obeacons.utils.MyDatabaseUtil;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

public class MessageViewActivity extends Activity {
	private ImageButton backHomeView;
	private ImageButton deleteMsgView;
	private TextView msgTitleView;
	private TextView msgContentView;
	private TextView msgTimeView;
	private String msgTimeData;
	private String data_id;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_messageview);
		String title = getIntent().getStringExtra("title");
		String content = getIntent().getStringExtra("content");
		data_id = getIntent().getStringExtra("id");
		msgTimeData = getIntent().getStringExtra("time");
		msgTitleView = (TextView) findViewById(R.id.msg_title);
		msgContentView = (TextView) findViewById(R.id.msg_content);
		msgTimeView = (TextView) findViewById(R.id.msg_time);
		msgTitleView.setText(title);
		msgContentView.setText(content);
		msgTimeView.setText(msgTimeData);
		backHomeView = (ImageButton) findViewById(R.id.btn_home);
		backHomeView.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});
		deleteMsgView = (ImageButton) findViewById(R.id.btn_delete);
		deleteMsgView.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				MyDatabaseUtil.deletePushData(data_id);
				finish();
			}
		});
	}
}
